#include "DeviceDepth.h"
#include "common.h"

using namespace std;

DeviceDepth::~DeviceDepth() {
    close(m_fd);
    m_fd = -1;
}


void DeviceDepth::func(Depth_data& data) {
    getBuf();

    // cout << "Inertial data:" << m_buf << endl;

    // 解析深度计数据
    sscanf(m_buf.c_str(), "$ISDPT,%f,M,%f,B,%f,C*%d",&data.depth,&data.pressure,&data.temperature,&data.checksum); 
}